import { services } from '@/config'

export const tableOption = {
  labelPosition: 'left',
  labelSuffix: '：',
  labelWidth: 120,
  gutter: 0,
  menuBtn: true,
  submitBtn: true,
  submitText: '提交',
  emptyBtn: true,
  emptyText: '清空',
  menuPosition: 'center',
  align: 'center',
  index: true,
  border: true,
  stripe: true,
  menuAlign: 'center',
  indexLabel: '序号',
  searchMenuSpan: 4,
  viewBtn: true,
  column: [
    {
      type: 'input',
      label: '主键',
      prop: 'id',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '租户ID',
      prop: 'tenantId',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '数据删除标记',
      prop: 'delFlag',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'tree',
      label: '资产分类',
      prop: 'ctiId',
      span: 24,
      dicUrl: `${services.assetService}fyassetcti/tree`,
      dicMethod: 'get',
      props: { label: 'name', value: 'id' },
      hide: true,
      required: true,
      rules: [
        {
          required: true,
          message: '请选择资产类型'
        }
      ]
    },
    {
      type: 'input',
      label: '资产分类全名称',
      prop: 'classified',
      span: 12,
      display: false
    },
    {
      type: 'input',
      label: '资产分类全编码',
      prop: 'classifiedCode',
      span: 12,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '条形码',
      prop: 'barcode',
      span: 24,
      rules: [
        {
          required: true,
          message: '请填写条形码'
        }
      ]
    },
    {
      type: 'input',
      label: '资产名称',
      prop: 'name',
      search: true,
      searchSpan: 4,
      searchLabelWidth: 85,
      span: 24,
      maxlength: 120,
      rules: [
        {
          required: true,
          message: '请填写资产名称'
        }
      ]
    },
    {
      type: 'input',
      label: '规格型号',
      prop: 'model',
      span: 24,
      search: true,
      searchSpan: 4,
      searchLabelWidth: 85,
      rules: [
        {
          required: true,
          message: '请填写规格型号'
        }
      ]
    },
    {
      type: 'number',
      label: '金额',
      prop: 'amount',
      span: 24
    },
    {
      type: 'input',
      label: '计量单位',
      prop: 'unit',
      searchSpan: 4,
      search: true,
      searchLabelWidth: 85,
      span: 24,
      rules: [
        {
          required: true,
          message: '请填写计量单位'
        }
      ]
    },
    {
      label: '照片',
      prop: 'picture',
      type: 'upload',
      listType: 'picture-img',
      limit: 1,
      accept: 'image/png, image/jpeg, image/jpg',
      fileSize: 1024,
      span: 7,
      propsHttp: {
        res: 'data'
      },
      tip: '请上传jpg/png格式图片，且不超过1024kb',
      action: `${services.adminService}sys-file/upload`,
      hide: true
    }
  ]
}

export const tableOptionData = [
  {
    type: 'input',
    label: '主键',
    prop: 'id',
    span: 12,
    display: false,
    hide: true
  },
  {
    type: 'input',
    label: '资产名称',
    prop: 'sauName',
    search: true,
    searchSpan: 4,
    searchLabelWidth: 85,
    span: 24,
    maxlength: 120
  },
  {
    type: 'input',
    label: '金额',
    prop: 'sauAmount',
    span: 24
  },
  {
    type: 'input',
    label: '规格型号',
    prop: 'sauModel',
    span: 24
  },
  {
    type: 'input',
    label: '计量单位',
    prop: 'sauUnit',
    span: 24
  },
  {
    type: 'input',
    label: '资产分类ID',
    prop: 'ctiId',
    span: 24,
    hide: true
  },
  {
    type: 'input',
    label: '资产分类名称',
    prop: 'ctiName',
    span: 24
  },
  {
    type: 'input',
    label: '资产分类编码',
    prop: 'ctiCode',
    span: 24
  } /*,
  {
    type: 'input',
    label: '资产分类全名称',
    prop: 'ctiFullName',
    span: 24
  },
  {
    type: 'input',
    label: '资产分类全编码',
    prop: 'ctiFullCode',
    span: 24
  } */
]
